<%@ page language="java"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
    <base href="<%=basePath%>">
    <title>首页审核列表</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0">

    <!-- 引用新样式 start -->
    <%--<jsp:include page="../../jsp/public.jsp" flush="true"/>--%>
    <!-- end -->
    <link rel="stylesheet" type="text/css" href="<%=basePath%>css/new/bootstrap.css"/>
    <link rel="stylesheet" type="text/css" href="<%=basePath%>css/new/style.css"/>
    <link rel="stylesheet" type="text/css" href="<%=basePath%>css/new/reset.css"/>
    <!-- end -->
    <!-- 引用公共js start-->
    <script type="text/javascript" src="<%=basePath%>js/new/jquery.min.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/new/bootstrap.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/layer/layer.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/common/message.js"></script>

    <script type="text/javascript" src="<%=basePath%>js/index/indexAudit.js"></script>
    <script>
        //提交表单
        function queryModelList() {
            var data = $("#queryForm").serialize();
            window.location.href = "<%=path%>/bus/index/index?" + data;
        }
    </script>
    <style type="text/css">
        .no-bar::-webkit-scrollbar {

            display: none;
        }

        /* .hand-like{
            cursor:pointer;
        } */
        * {
            margin: 0;
            padding: 0;
            list-style-type: none;
        }

        a, img {
            border: 0;
        }

        /*按钮样式*/
        #ClickMe {
            width: 200px;
            height: 30px;
            border: 1px solid #C40000;
            background-color: #000;
            color: #FFF;
            margin: 0 auto;
        }

        #goodcover {
            display: none;
            position: absolute;
            top: 0%;
            left: 0%;
            width: 100%;
            height: 100%;
            background-color: black;
            z-index: 1001;
            -moz-opacity: 0.8;
            opacity: 0.50;
            filter: alpha(opacity=80);
        }

        #code {
            width: 800px;
            height: 100%;
            background-color: #fff;
            display: none;
            left: 0%;
            z-index: 1002;
            overflow: hidden;
        }

        /* .close1 {
            width: 300px;
            height: 0px;
        }

        #closebt {
            float: right;
        }

        #closebt img {
            width: 20px;
        } */

        .goodtxt {
            text-align: center;
            /* width:500px;
            height:500px; */
        }

        .goodtxt p {
            height: 30px;
            line-height: 30px;
            font-size: 16px;
            color: #000;
            font-weight: 600;
        }

        body, p, ul, ol, li {
            margin: 0;
            padding: 0;
        }

        ul, ol {
            list-style: none;
        }

        img {
            border: none;
        }

        a, button {
            outline: none;
        }

        .clearfix:after {
            visibility: hidden;
            display: block;
            font-size: 0;
            content: " ";
            clear: both;
            height: 0;
        }

        /* 具体样式 */
        .banner {
            position: relative;
            height: 400px;
            overflow: hidden;
        }

        .banner .bannerCon {
            position: absolute;
            top: 0;
            left: 50%;
            width: 800px;
            height: 400px;
            margin-left: -400px;
            overflow: hidden;
        }

        .bannerCon .imgList {
            position: absolute;
            top: 0;
            left: 0;
            width: 99999px;
            height: 400px;
        }

        .bannerCon .imgList li {
            float: left;
            width: 800px;
            height: 500px;
        }

        .bannerCon .imgList li a {
            position: relative;
            display: block;
            height: 100%;
        }

        .bannerCon .imgList li img {
            width: 800px;
            height: 400px;
        }

        .bannerCon .pre-nex {
            display: none;
            position: absolute;
            top: 50%;
            width: 40px;
            height: 60px;
            margin-top: -40px;
            font: bold 40px/60px Simsun;
            color: #ccc;
            text-align: center;
            border: none;
            background: rgba(0, 0, 0, .30);
            filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr=#4c000000, endColorStr=#4c000000);
            cursor: pointer;
            z-index: 3;
        }

        .bannerCon .pre-nex.show {
            display: inline-block;
        }

        .bannerCon .prev {
            left: 13%;
        }

        .bannerCon .next {
            right: 13%;
        }

        .bannerCon .btnList {
            position: absolute;
            left: 0;
            bottom: 20px;
            width: 100%;
            height: 12px;
            text-align: center;
            z-index: 2;
            _overflow: hidden;
        }

        .bannerCon .btnList li {
            display: inline;
        }

        .bannerCon .btnList li span {
            display: inline-block;
            width: 12px;
            height: 12px;
            margin: 0 5px;
            border-radius: 6px;
            background-color: #14829e;
            cursor: pointer;
        }

        .bannerCon .btnList li.cur span {
            background-color: #f30;
        }


    </style>

</head>
<body>

<div class="col-lg-12">
    <div class="index-nav-right">
        <div class="index-nav-right-header"><span>当前位置>首页</span></div>
    </div>
    <div class="right-table">
        <form id="queryForm" method="post" action="<%=path%>/bus/index/index">
            <div class="search-form">
                <div class="search-form-input">
                    <label>部品番号</label><input type="text" name="modelCode" id="modelCode"
                                              value="${map['modelCode'] }"/>
                </div>
                <div class="search-form-input">
                    <label>机种:</label>
                    <select name="modelType" id="modelType">
                        <option value="">请选择</option>
                        <c:if test="${not empty mTypeList}">
                            <c:forEach items="${mTypeList }" var="mTypeList"
                                       varStatus="m">
                                <option value="${mTypeList.targetName}"
                                        <c:if test="${map['modelType'] ==mTypeList.targetName }">selected</c:if>>${mTypeList.targetName}</option>
                            </c:forEach>
                        </c:if>
                    </select>
                </div>
                <div class="search-form-input">
                    <label>厂商名称</label>
                    <select name="orgName" id="orgName">
                        <option value="">请选择</option>
                        <c:if test="${not empty factoryList}">
                            <c:forEach items="${factoryList }" var="factoryList"
                                       varStatus="m">
                                <option value="${factoryList.orgName}"
                                        <c:if test="${factoryList.orgName==map['orgName']}">selected</c:if>
                                >${factoryList.orgName}</option>
                            </c:forEach>
                        </c:if>
                    </select>
                </div>
                <div class="search-form-input">
                    <label>提交时间</label>
                    <input class="Wdate" name="reportDate" id="reportDate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
                           value="${map['reportDate'] }"/>
                </div>
                <div class="search-form-input">
                    <label>审核状态</label>
                    <select name="status" id="status">
                        <option value="">请选择</option>
                        <option value="0"
                                <c:if test="${map['status']=='0' }">selected</c:if>
                        >待审核
                        </option>
                        <option value="1"
                                <c:if test="${map['status']=='1' }">selected</c:if>
                        >待二审
                        </option>
                        <option value="2"
                                <c:if test="${map['status']=='2' }">selected</c:if>
                        >已完成
                        </option>
                        <option value="3" <c:if test="${map['status']=='3' }">selected</c:if>>已拒绝</option>
                    </select>
                </div>
                <div class="search-form-btn search-form-input" style="margin-right: 40px;border: 0px solid red;">
                    <button type="submit" class="btn btn-primary search-form-btn-s" style="color:rgba(29,25,18,0.82);">
                        搜索
                    </button>
                </div>


            </div>
        </form>

        <div class="index-table">
            <table class="table table-striped" action="<%=path%>/bus/index/index">
                <thead>
                <tr class="table-thead">
                    <th>序号</th>
                    <th>部品番号</th>
                    <th>机种</th>
                    <th>厂商名称</th>
                    <th>提交人</th>
                    <th>审核人</th>
                    <th>提交时间</th>
                    <th>审核时间</th>
                    <th>审核状态</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <c:if test="${not empty list}">
                    <c:forEach items="${list }" var="audit" varStatus="r">
                        <tr>
                            <td>${r.index+1 }</td>
                            <td>${audit.modelCode }</td>
                            <td>${audit.modelType }</td>
                            <td>${audit.orgName }</td>
                            <td>${audit.createBy }</td>
                            <td>${audit.auditor }</td>
                            <td>${audit.createTime }</td>
                            <td>${audit.auditTime }</td>
                            <td><c:choose>
                                <c:when test="${audit.auditStatus == '待审核'}">
                                    <span>${audit.auditStatus}</span>
                                </c:when>
                                <c:when test="${audit.auditStatus == '已完成'}">
                                    <span style="color: green">${audit.auditStatus}</span>
                                </c:when>
                                <c:when test="${audit.auditStatus == '已通过'}">
                                    <span style="color: black">待二审</span>
                                </c:when>
                                <c:otherwise>
                                    <span style="color: red">${audit.auditStatus}</span>
                                </c:otherwise>
                            </c:choose></td>
                            <td id="${audit.recordId }">
                                <c:choose>
                                    <c:when test="${audit.reviewStatus == '0'}">
                                        <c:if test="${audit.auditStatus == '待审核' }"> <span class="hand-like"
                                                                                           data-toggle="modal"
                                                                                           data-target="#myModal"
                                                                                           onClick='toAudit("${audit.recordId}")'>审核</span> </c:if>
                                        <c:if test="${audit.auditStatus == '已拒绝' }">
                                            <span class="hand-like" data-toggle="modal" data-target="#myModal"
                                                  onClick='toView("${audit.recordId}","${audit.recordDetailId }")'>查看</span>
                                        </c:if>

                                    </c:when>
                                    <c:when test="${audit.reviewStatus == '1'}">
                                        <span <c:if
                                                test="${audit.auditStatus == '已通过' and audit.flag == '1' }"> class = "hand-like" data-toggle="modal" data-target="#myModal" onClick = 'toAudit("${audit.recordId}")'</c:if>>审核</span>
                                    </c:when>
                                    <c:when test="${audit.auditStatus == '已完成'}">
                                        <span class="hand-like" data-toggle="modal" data-target="#myModal"
                                              onClick='toView("${audit.recordId}","${audit.recordDetailId }")'>查看</span>
                                    </c:when>
                                    <c:when test="${audit.auditStatus == '已拒绝'}">
                                        <span class="hand-like" data-toggle="modal" data-target="#myModal"
                                              onClick='toView("${audit.recordId}","${audit.recordDetailId }")'>查看</span>
                                    </c:when>
                                    <c:otherwise>
                                        <span>审核</span>
                                        <!-- <span class="span1" onClick=''>查看</span> -->
                                    </c:otherwise>
                                </c:choose>
                            </td>
                        </tr>
                    </c:forEach>
                </c:if>
                <c:if test="${empty list}">
                    <tr>
                        <td colspan="15"><label
                                class="control-label text-center">无记录</label></td>
                    </tr>
                </c:if>
                </tbody>
                <tr style="background: #f8f8f8">
                    <td colspan="15">
                        <jsp:include page="/WEB-INF/jsp/page.jsp"></jsp:include>
                    </td>
                </tr>
            </table>
        </div>

    </div>
</div>

<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog" style="border: 0px solid red;width: 80%;">
        <div class="modal-content">
            <div class="modal-header" style="height: 5px;">
                <button type="button" class="close" data-dismiss="modal"
                        aria-hidden="true">×
                </button>
            </div>
            <div class="modal-body">
                <div class="close1">
                    <a href="javascript:void(0)" id="closebt"></a>
                </div>
                <div class="goodtxt">
                    <div class="wrap">
                        <div class="banner">
                            <div class="bannerCon">
                                <ul class="imgList clearfix">

                                </ul>
                                <ul class="btnList clearfix">

                                </ul>
                                <span class="pre-nex prev"><</span>
                                <span class="pre-nex next">></span>
                            </div>
                        </div>
                    </div>
                </div>
                <div style="margin-top: 0px">
                    <div class="goodtxt" class="table-responsive">
                        <table class="table table-hover">
                            <tr>
                                <td>计划进度:</td>
                                <th class=""><span id="planProgress">${progress.planProgress }</span></th>
                                <td>计划完成比例:</td>
                                <th class=""><span id="planPro">${progress.planPro}</span><span>%</span></th>
                            </tr>
                            <tr>
                                <td class="">汇报日期:</td>
                                <th class="" id="rp"><span id="reportDate2">${progress.reportDate }</span></th>
                                <td>目标精度:</td>
                                <th class=""><span id="targetPre">${progress.targetPre }</span><span>%</span></th>
                            </tr>
                            <tr>
                                <td>当前进度:</td>
                                <th class=""><span id="currentPro">${progress.currentPro }</span></th>
                                <td>实际完成比例:</td>
                                <th class=""><span id="accPro"></span><span>%</span></th>
                            </tr>
                            <tr>
                                <td>实际精度:</td>
                                <th class=""><span id="accPre"></span><span>%</span></th>
                                <td>进度状态:</td>
                                <th class=""><span id="proStatus">${progress.proStatus }</span></th>
                            </tr>
                            <tr>
                                <td>提前/延期天数:</td>
                                <th class=""><span id="extDay"></span></th>
                                <td>提前/延期原因:</td>
                                <th class=""><span id="extReason"></span></th>
                            </tr>
                            <tr>
                                <td>备注：</td>
                                <th class=""><span id = "bak">{progress.remark}</span></th>
                                <td></td>
                                <th class=""></th>
                            </tr>
                            <tr>
                                <td>部品番号:</td>
                                <th class=""><span id="modelCode2"></span></th>
                                <td>审核结果:</td>
                                <th class="" id="ar"><select id="auditResult">
                                    <option value="1">通过</option>
                                    <option value="3">未通过</option>
                                </select></th>
                            </tr>
                        </table>
                        <div class="form-group">
                            审核意见:<textarea id="advise" class="form-control"></textarea>
                        </div>
                    </div>
                    <div class="col-sm-8 col-btn-12">

                    </div>
                    <input id="recordId" hidden="true" value="">
                    <input id="progressId" hidden="true" value="">
                    <input id="reviewRcdId" hidden="true" value=""/>
                </div>

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default"
                        data-dismiss="modal">关闭
                </button>
                <button type="button" class="btn btn-primary" id="tj" onClick="audit()">
                    提交
                </button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

</body>
</html>